package com.guigu.qingcheng.service;

import com.qingcheng.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Component
@FeignClient("service-order")
public interface CartFegin {

    @GetMapping("/orders/cart/findCartList")
    List<Map<String,Object>> findCartList(@RequestParam String username);

    @PostMapping("/orders/cart/addItem")
    Result addItem(@RequestParam String skuId,@RequestParam Integer num,@RequestParam String username);

    @GetMapping("/orders/cart/deleteCart")
    Result deleteCart(@RequestParam String username);

    @PostMapping("/orders/cart/updateChecked")
    Result updateChecked(@RequestParam String skuId,@RequestParam boolean checked,@RequestParam String username);

    @GetMapping("/orders/cart/preferential")
    Result preferential(@RequestParam String username);

    @GetMapping("/orders/cart/findNewOrderItemList")
    List<Map<String,Object>> findNewOrderItemList(@RequestParam String username);
}
